<!-- 搜索 -->
<template>
    <div class="search" :style="boxStyle">
        <div class="search-input">
            <el-icon><icon-search /></el-icon>
            {{ element.eles.content.placeholder }}
        </div>
    </div>
</template>

<script>
import { defineComponent, toRefs, computed } from 'vue'
export default defineComponent({
    name: 'WidgetSearch',
    props: {
        element: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props, { emit }) {
        const { element } = toRefs(props)

        const boxStyle = computed(() => {
            const style = element.value.eles.style || {}
            return {
                width: style.width,
                height: style.height,
                lineHeight: style['line-height'],
                marginTop: style['margin-top'],
                backgroundColor: style['background-color']
            }
        })
        
        return {
            element,
            boxStyle
        }
    }
})
</script>

<style lang="less" scoped>
@import './widget-search.less';
</style>